package fr.jee.web.bean.accueil;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;

import fr.jee.ejb.facade.NewsFacade;
import fr.jee.ejb.model.News;

@Named
public class AccueilBean {

	@Inject
	private NewsFacade newsFacade;

	private List<News> listeNews = new ArrayList<>();

	public AccueilBean() {
	}

	@PostConstruct
	private void initialisation() {
		listeNews = newsFacade.findAllNewsOrderByDateCreation();
	}

	public List<News> getListeNews() {
		return listeNews;
	}

	public void setListeNews(List<News> listeNews) {
		this.listeNews = listeNews;
	}

}
